import sys
 
from PyQt4.Qt import Qt, QObject, QApplication, QLineEdit, QCompleter,QDialog,  QStringListModel, SIGNAL
from PyQt4 import QtCore

from KDataBase.KQueryDB import KQueryDB
from KUI.KSmartSearch.ui_KChartCompleteDlg import Ui_KChartCompleteDlg


        
class KChartCompleteDlg(QDialog):
 
    SybmolObtained=QtCore.pyqtSignal(str)
    def __init__(self, parent=None):
        super(KChartCompleteDlg, self).__init__(parent)
        self.ui =  Ui_KChartCompleteDlg()
        self.ui.setupUi(self)  
        self.ui.StkLineEdit.SymbolObtained.connect(self.OnSymbolObtained)
    def OnSymbolObtained(self,text):
        self.ui.StkLineEdit.clear()
        self.SybmolObtained.emit(text) # pass the message from line edit outside
        self.close()

 
 

 
def main():
    app = QApplication(sys.argv)
 
    editor = KChartCompleteDlg()
 

 
    editor.show()
 
    return app.exec_()
 
if __name__ == '__main__':
    __package__ = "KChart"
    main()